package com.atguigu.practices.vo.req;

import com.atguigu.practices.annotation.Gender;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.*;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class EmployeeAddVO {

    @NotBlank(message = "姓名不能为空"/*, groups = Add.class*/)
    private String name;
    @NotNull(message = "年龄不能为空")
    @Max(value =150, message = "年龄不能超过150")
    @Min(value =0, message = "年龄不能小于0")
    private Integer age;
    @Email(message = "邮箱格式不对")
    private String email;

    //    @Pattern(regexp = "^男|女$", message = "性别只能为男或女")
    @Gender(message = "{gender.message}")
    private String gender;

    private String address;
    private BigDecimal salary;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date birth;
}
